public abstract class NB3Algorithm
extends java.lang.Object
Constructor and Description |
---|
NB3Algorithm()
Constructs an algorithm object with only 1 type of node (apart from the root).
|
NB3Algorithm(int numNodeTypes)
Constructs an algorithm object with the given number of node types.
|
Modifier and Type | Method and Description |
---|---|
void |
acceptOrPropose() |
abstract java.util.List<java.lang.Object> |
actions2Labels(java.util.List<? extends NB3Action> actions)
Converts the actions of an incoming message into a list of labels that can be added to the tree.
|
NB3Node |
addLabelsToTree(java.util.List<java.lang.Object> branchLabels)
Adds a branch to the tree that contains the given labels.
|
abstract java.util.List<? extends NB3Action> |
branch2actions(java.util.List<NB3Node> branch)
Converts NodeLabels into Actions.
|
void |
calculateBounds(NB3Node node,
java.util.ArrayList<NB3Node> branch,
NB3AgentSet pa) |
abstract float |
calculateIntermediateValue(int agentID,
java.util.List<NB3Node> branch,
NB3WorldState ws) |
abstract float |
calculateLowerBound(int agentID,
java.util.List<NB3Node> branchs,
NB3WorldState ws) |
float |
calculateProbability(NB3Node node,
int ag)
Calculates the probability that agent ag will accept the plan corresponding to the node.
|
abstract float |
calculateUpperBound(int agentID,
java.util.List<NB3Node> branch,
NB3WorldState ws) |
void |
enableLoggers(java.lang.String folderPath) |
void |
expand()
Picks the best unexplored node in the tree and adds children to it.
|
int |
getNumAcceptedByUs()
Returns the number of deals that have been accepted by this agent.
|
int |
getNumberOfNodesGenerated() |
int |
getNumDealsMade()
Returns the number of deals that have been confirmed.
|
int |
getNumFoundByUs()
Returns the number of rational deals found by the search algorithm.
|
int |
getNumProposedByUs()
Returns the number of deals that have been proposed by this agent.
|
int |
getNumProposedToUs()
Returns the number of deals that have been proposed to this agent.
|
abstract NB3AgentSet |
getParticipatingAgents(java.util.ArrayList<NB3Node> branch)
Necessary in order to create a proposal object (which needs to know the pa in order to determine whether how
many agents still need to accept).
|
void |
handleIncomingMessages(NB3Message msg)
Handles incoming messages.
|
void |
initialize(java.lang.String myName,
java.lang.String[] agentNames,
NB3WorldState initialState,
long deadline)
Once all information necesarry for the negotiation algorithm is available, the agent should call this method to start the algorithm.
|
void |
setConcessionDegrees(double opp_concession_degree,
double my_concession_degree)
Sets the speed of concession of the algorithm.
|
void |
writeLogFiles() |
public NB3Algorithm()
public NB3Algorithm(int numNodeTypes)
numNodeTypes
- The number of types of nodes, excluding the root node.public int getNumFoundByUs()
public int getNumProposedToUs()
public int getNumProposedByUs()
public int getNumAcceptedByUs()
public int getNumDealsMade()
public void enableLoggers(java.lang.String folderPath)
public void setConcessionDegrees(double opp_concession_degree, double my_concession_degree)
concessionDegree1
- concessionDegree2
- public void initialize(java.lang.String myName, java.lang.String[] agentNames, NB3WorldState initialState, long deadline)
myName
- The name of the agent.agentNames
- The name of all agents in the negotiation session, including the name of this agent.initialState
- The WorldState object that represents the state at the beginning of the negotiations.deadline
- The deadline after which the negotiations will stop.public void expand()
public abstract NB3AgentSet getParticipatingAgents(java.util.ArrayList<NB3Node> branch)
labels
- public void handleIncomingMessages(NB3Message msg)
msg
- public abstract java.util.List<java.lang.Object> actions2Labels(java.util.List<? extends NB3Action> actions)
actions
- public abstract java.util.List<? extends NB3Action> branch2actions(java.util.List<NB3Node> branch)
labels
- The first element in this list is the label of the root node, and the last element is the label of the lowest node.public NB3Node addLabelsToTree(java.util.List<java.lang.Object> branchLabels)
branchLabels
- public void acceptOrPropose()
public void calculateBounds(NB3Node node, java.util.ArrayList<NB3Node> branch, NB3AgentSet pa)
public abstract float calculateUpperBound(int agentID, java.util.List<NB3Node> branch, NB3WorldState ws)
public abstract float calculateIntermediateValue(int agentID, java.util.List<NB3Node> branch, NB3WorldState ws)
public abstract float calculateLowerBound(int agentID, java.util.List<NB3Node> branchs, NB3WorldState ws)
public float calculateProbability(NB3Node node, int ag)
public void writeLogFiles()
public int getNumberOfNodesGenerated()